<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var _msg="初始变量";
        var data={

        };
        Object.defineProperty(data,"msg",{
            get(){
                console.log("data.msg的get方法!");
                return _msg;
            },
            set(nv){
                console.log("data.msg的set方法!");
                _msg=nv;
            }
        })
        data.msg;
        
    </script>
</head>
<body>
    
</body>
</html>